import asyncio
from tortoise import Tortoise
from tool.sessing import TORTOISE_ORM
from models.m import Chapter

async def delete_chapters():
    await Tortoise.init(config=TORTOISE_ORM)
    
    count = await Chapter.all().count()
    print(f"当前章节数: {count}")
    
    # 删除所有章节
    deleted = await Chapter.all().delete()
    print(f"已删除 {deleted} 个章节")
    
    await Tortoise.close_connections()

asyncio.run(delete_chapters())

